<template>
  <div class="table-tb">
    <div
      class="table-item"
      v-for="(item, index) in props.tableData"
      :key="index"
    >
      <div class="item-cloumn1 cloumn1">{{ item.type }}</div>
      <div class="item-cloumn2">
        <div
          class="item-box tableItemR"
          v-for="(itemC, idxC) in item.child"
          :key="idxC"
        >
          <div class="cloumn-box cloumn2">{{ itemC.position }}</div>
          <div class="cloumn-box cloumn3">{{ itemC.workload }}</div>
          <div class="cloumn-box cloumn4">{{ itemC.onlinePersonnel }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import type {PropType } from 'vue'
import type {Item} from '../types/department'
const props = defineProps({
  tableData: {
    type:Array as PropType<Item[]>,
    default: [],
  },
});
</script>

<style scoped lang="scss">
.table-tb {
  // height: 204px;
  border: 1px solid #e5e5e5;
  border-top: 0;
  overflow: hidden;
  // overflow-y: scroll;

  .table-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    .item-cloumn1 {
      padding: 0 12px;
      box-sizing: border-box;
      font-size: 14px;
    }
    .item-cloumn2 {
      .item-box {
        display: flex;
        height: 34px;

        border-bottom: 1px solid #e5e5e5;

        .cloumn-box {
          display: flex;
          align-items: center;
          padding: 0 8px;
          box-sizing: border-box;
          font-size: 13px;
          border-left: 1px solid #e5e5e5;
        }
      }
      .item-box:last-of-type {
        border-bottom: 0;
      }
    }
  }
}
.table-tb::-webkit-scrollbar {
  display: none;
}
.cloumn1 {
  width: 100px;
}
.cloumn2 {
  width: 100px;
}
.cloumn3 {
  width: 77px;
  // flex: 1;
}
.cloumn4 {
  // flex: 1;
  width: 76px;
}
</style>
